%%% File    : chat_sup.erl
%%% Author  :  <whhbest>
%%% Description : 
%%% Created : 26 Feb 2011 by  <>

-module(chat_sup).

-behaviour(supervisor).

-export([start_link/0]).
%%supervisor callbacks
-export([init/1]).

-define(Supname, chat_sup).

start_link() ->
    supervisor:start_link({global, ?Supname}, ?MODULE, []).

%%------------------------supervisor callbacks
init([]) ->
    Supflags = {one_for_one, 3, 10},
    Dis_sup = {dis_sup, {dis_sup, start_link, []},
	      permanent, 1000, worker, [dis_sup]},
    Gate_sup = {gate_sup, {gate_sup, start_link, []},
	       permanent, 1000, worker, [gate_sup]},
    
    Net_sup = {netser_sup, {netser_sup, start_link, []},
	      permanent, 1000, worker, [nerser_sup]},
    
   
    Db_sup = {db_sup, {db_sup, start_link, []},
	     permanent, 1000, worker, [db_sup]},

    Cache_sup ={cache_sup, {cache_sup, start_link, []},
	       permanent, 1000, worker, [cache_sup]},

    Exchange_sup = {exchange_sup, {exchange_sup, start_link, []},
		   permanent, 1000, worker, [exchange_sup]},

    {ok, {Supflags, [Dis_sup,  Net_sup, Db_sup]}}.
    
